package com.opesoft.pf.hibernate;

import java.io.Serializable;
import java.util.Date;

import org.apache.log4j.Logger;
import org.hibernate.HibernateException;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.id.IdentifierGenerator;

public class TimeIdGenerator implements IdentifierGenerator
{
	public Logger log=Logger.getLogger(this.getClass());

	synchronized public Serializable generate(SessionImplementor si,Object obj) throws HibernateException
	{
		return new Date().getTime()+"_"+obj.hashCode();
	}

}
